<html>
 <head>
  <meta charset="UTF-8">
 </head>
 <body>
  <h1 data-lake-id="PeUuY" id="PeUuY"><span data-lake-id="u03f1c56a" id="u03f1c56a">典型回答</span></h1>
  <p data-lake-id="uad58d6bd" id="uad58d6bd"><br></p>
  <p data-lake-id="u8222b632" id="u8222b632"><span data-lake-id="u82c73698" id="u82c73698">当我们在在对比Ribbon和Nginx的时候，主要对比的是他们的负载均衡方面的区别。</span></p>
  <p data-lake-id="ub58db2e0" id="ub58db2e0"><span data-lake-id="uc457634f" id="uc457634f">​</span><br></p>
  <p data-lake-id="udd151096" id="udd151096"><strong><span data-lake-id="u93c4b788" id="u93c4b788">这两者最主要的区别是Nginx是一种服务端负载均衡的解决方案，而Ribbon是一种客户端负载均衡的解决方案。</span></strong></p>
  <p data-lake-id="ue98d56d8" id="ue98d56d8"><span data-lake-id="ua926b2f7" id="ua926b2f7">​</span><br></p>
  <p data-lake-id="u21a5c5aa" id="u21a5c5aa"><span data-lake-id="u96b4746f" id="u96b4746f">服务端负载均衡指的是将负载均衡的逻辑集成到服务提供端，通过在服务端对请求进行转发，实现负载均衡。</span></p>
  <p data-lake-id="u59bb1d0b" id="u59bb1d0b"><span data-lake-id="uaa4efb89" id="uaa4efb89">​</span><br></p>
  <p data-lake-id="u7f98a48c" id="u7f98a48c"><img src="https://cdn.nlark.com/yuque/0/2023/png/5378072/1681550255675-ae1143cb-93b0-415c-98d5-e41c1577165e.png?x-oss-process=image%2Fwatermark%2Ctype_d3F5LW1pY3JvaGVp%2Csize_40%2Ctext_SmF2YSA4IEd1IFA%3D%2Ccolor_FFFFFF%2Cshadow_50%2Ct_80%2Cg_se%2Cx_10%2Cy_10"></p>
  <p data-lake-id="ub43a014e" id="ub43a014e"><span data-lake-id="uefd45b72" id="uefd45b72">​</span><br></p>
  <p data-lake-id="uf2bb8208" id="uf2bb8208"><span data-lake-id="u97ab03d4" id="u97ab03d4">客户端负载均衡指的是将负载均衡的逻辑集成到服务消费端的代码中，在客户端直接选择需要调用的服务提供端，并发起请求。这样的好处是可以在客户端直接实现负载均衡、容错等功能，不需要依赖其他组件，使得客户端具有更高的灵活性和可控性。</span></p>
  <p data-lake-id="uc0b4503c" id="uc0b4503c"><span data-lake-id="u259e323a" id="u259e323a">​</span><br></p>
  <p data-lake-id="ud53ea3dc" id="ud53ea3dc"><img src="https://cdn.nlark.com/yuque/0/2023/png/5378072/1681550362054-7aa652d7-afdb-4e58-a6de-c5862dc39387.png?x-oss-process=image%2Fwatermark%2Ctype_d3F5LW1pY3JvaGVp%2Csize_31%2Ctext_SmF2YSA4IEd1IFA%3D%2Ccolor_FFFFFF%2Cshadow_50%2Ct_80%2Cg_se%2Cx_10%2Cy_10"></p>
  <p data-lake-id="uf344acfb" id="uf344acfb"><br></p>
  <p data-lake-id="u45b90865" id="u45b90865"><span data-lake-id="ua5b357fd" id="ua5b357fd">Nginx是需要单独部署一个Nginx服务的，这样他才能做好服务端负载均衡，而Ribbon是需要在服务消费端的机器代码中引入，和应用部署在一起，这样他才能实现客户端的负载均衡。</span></p>
  <p data-lake-id="u38a0152e" id="u38a0152e"><span data-lake-id="u5eecde2e" id="u5eecde2e"><br></span><span data-lake-id="uc3114527" id="uc3114527"> </span></p>
 </body>
</html>